package org.simp.interceptor;

import org.apache.log4j.Logger;
import org.simp.annotation.SimpControllerManager;
import org.simp.core.body.decoder.SimpBodyDecoder;
import org.simp.core.message.SimpMessage;
import org.simp.core.request.SimpRequest;
import org.simp.handler.SimpHandler;

public class ClientHandlerInterceptor extends AbstractHandlerInterceptor{
	private static final Logger log = Logger.getLogger(ClientHandlerInterceptor.class);
	
	public ClientHandlerInterceptor(SimpBodyDecoder decoder,
			SimpControllerManager manager) {
		super(decoder, manager);
		// TODO Auto-generated constructor stub
	}


	@Override
	public boolean preHandler(SimpRequest request, SimpHandler handler) {
		log.debug(" receive message mainId : " + request.getHead().getMainId() + " moudleId :" + request.getHead().getMoudleId());

		return true;
	}

	@Override
	public void postHandler(SimpRequest request, SimpMessage message,
			SimpHandler handler) {
		log.debug(" request completed mainId : " + request.getHead().getMainId() + " moudleId :" + request.getHead().getMoudleId());
		
	}

	@Override
	public void throwSimpRequest(SimpRequest request, SimpHandler handler) {
		log.debug(" thorw message  mainId : " + request.getHead().getMainId() + " moudleId :" + request.getHead().getMoudleId());
		
	}

}
